<template>
  <div>
    <!-- banner -->
    <div class="tag-banner banner">
      <h1 class="banner-title">资源分类</h1>
    </div>
    <!-- 标签列表 -->
    <v-card class="blog-container">
      <div class="tag-cloud">
        <router-link
          :style="{ 'font-size': Math.floor(Math.random() * 10) + 18 + 'px' }"
          v-for="item of classifyList"
          :key="item.id"
          :to="'/resource/'+item.id"
        >
          {{ item.classifyName }}
        </router-link>
      </div>
    </v-card>
  </div>
</template>

<script>
import {getClassify} from '../../api/resource';
export default {
  created() {
    this.getClassifyList();
  },
  data: function() {
    return {
      classifyList: [],
    };
  },
  methods: {
    //查询分类
     getClassifyList(){
      getClassify().then(res=>{
        if(res.data.code==200){
          this.classifyList=res.data.data;
        }
      })
     }
  }
};
</script>

<style scoped>
.tag-banner {
  background: url(http://www.lsc-it.cn/%E8%B5%84%E6%BA%90.jpg) center center /
    cover no-repeat;
  background-color: #49b1f5;
}
.tag-cloud-title {
  line-height: 2;
  font-size: 36px;
  text-align: center;
}
@media (max-width: 759px) {
  .tag-cloud-title {
    font-size: 25px;
  }
}
.tag-cloud {
  text-align: center;
}
.tag-cloud a {
  color: #616161;
  display: inline-block;
  text-decoration: none;
  padding: 0 8px;
  line-height: 2;
  transition: all 0.3s;
}
.tag-cloud a:hover {
  color: #03a9f4 !important;
  transform: scale(1.1);
}
</style>
